package cn.yyh.user.service.impl;

import cn.yyh.basic.service.impl.BaseServiceImpl;
import cn.yyh.user.mapper.UserAddressMapper;
import cn.yyh.user.mapper.UserMapper;
import cn.yyh.user.pojo.po.User;
import cn.yyh.user.pojo.po.UserAddress;
import cn.yyh.user.service.IUserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserAddressServiceImpl extends BaseServiceImpl<UserAddressMapper, UserAddress> implements IUserAddressService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<UserAddress> listAll(Long id) {
        User user = userMapper.getByLoginInfoId(id);
        return baseMapper.getByUserId(user.getId());
    }
}
